local jiaohao = fk.CreateSkill {
  name = "jiaohao&",
}

jiaohao:addEffect("active", {
  anim_type = "support",
  card_num = 1,
  target_num = 1,
  prompt = "#jiaohao&",
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
  end,
  card_filter =function (self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip and Fk:currentRoom():getCardArea(to_select) ~= Card.PlayerEquip
  end,
  target_filter =function (self, player, to_select, selected, selected_cards)
    if #selected == 0 and #selected_cards == 1 then
      local target = to_select
      local card = Fk:getCardById(selected_cards[1])
      return to_select ~= player and to_select:hasSkill("jiaohao") and
        target:hasEmptyEquipSlot(card.sub_type)
    end
  end,
  on_use = function(self, room, effect)
    room:moveCards({
      ids = effect.cards,
      from = effect.from,
      to = effect.tos[1],
      toArea = Card.PlayerEquip,
      moveReason = fk.ReasonPut,
      skillName = "jiaohao",
    })
  end,
})

return jiaohao